package cn.echo.common.filter;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.util.Enumeration;

/**
 * Created by Administrator on 2017/4/13.
 */
public class NewRequest extends HttpServletRequestWrapper {
    private HttpServletRequest request;
    public NewRequest(HttpServletRequest request){
        super(request);
        this.request = request;
    }


    //过滤器重写getParameter()方法，解决中文乱码问题
    @Override
    public String getParameter(String s)	{
        String str=request.getParameter(s);
        try{
            str=new String(str.getBytes("ISO-8859-1"),"utf-8");
        }catch(Exception e)
        {
            e.printStackTrace();
        }
        return str;
    }
}
